package com.stefan.lession01;

import java.awt.*;

public class TestGridLayout {

    public static void main(String[] args) {
        Frame frame = new Frame("TestGridLayout");

        Button bth1 = new Button("bth1");
        Button bth2 = new Button("bth2");
        Button bth3 = new Button("bth3");
        Button bth4 = new Button("bth4");
        Button bth5 = new Button("bth5");

        frame.setLayout(new GridLayout(3,2));
        frame.add(bth1);
        frame.add(bth2);
        frame.add(bth3);
        frame.add(bth4);
        frame.add(bth5);

        frame.pack(); // Java函数！

        frame.setVisible(true);
//        frame.setSize(200,200);
    }
}
